package com.winway.sixbook;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.widget.TextView;

public class StartActivity extends Activity {
	
	private static final String TAG = "StartActivity";
	private TextView start_textview_cynr = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		final View view = View.inflate(this, R.layout.startactivity, null);
		setContentView(view);
		
		//初始化
		this.startInit(view);
	}
	/***
	 * 
	 * 初始化
	 * 
	 */
	private void startInit(View view){
//		start_textview_cynr = (TextView)findViewById(R.id.start_textview_cynr);
//		String jdsc_text=(String) this.getResources().getString(R.string.start_textview_cynr);
//		start_textview_cynr.setText("\u3000\u3000"+jdsc_text);
		
		AlphaAnimation aa = new AlphaAnimation(0.3f,1.0f);
		aa.setDuration(2000);
		view.startAnimation(aa);
		aa.setAnimationListener(new AnimationListener()
		{
			@Override
			public void onAnimationEnd(Animation arg0) {
				redirectTo();
			}
			@Override
			public void onAnimationRepeat(Animation animation) {}
			@Override
			public void onAnimationStart(Animation animation) {}
			
		});
	}
	/**
     * 转向
     */
    private void redirectTo(){        
//        Intent intent = new Intent(this, MainActivity.class);
    	Intent intent = new Intent(this, HomeActivity.class);
        startActivity(intent);
        finish();
    }
}
